package net.xju3_4.service.impl;

import net.xju3_4.common.utils.PageInfo;
import net.xju3_4.dao.UserDao;
import net.xju3_4.entity.User;
import net.xju3_4.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {

    UserDao userDao = new UserDao();

    @Override
    public List<User> list() {
        // 业务层 =》持久层
        List<User> userList = userDao.list();
        return userList;
    }

    @Override
    public User login(String username, String password) {
        return userDao.login(username,password);
    }

    @Override
    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public User selectOne(int id) {
        return userDao.selectOne(id);
    }

    @Override
    public void deleteById(int id) {
        userDao.deleteById(id);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public PageInfo<User> pageList(String username, String gender, Integer pageNo, Integer pageSize) {
        return userDao.pageList(username,gender,pageNo,pageSize);
    }
}
